const { app,Menu} = require('electron')
/**
创建工具栏*/
class MenuPersonal{

    constructor(win) {
        this.win = win
    }
    createMenu(){
        if (process.env.NODE_ENV !== 'development') {
            const template = [{
                label: '文件',
                submenu: [
                    {
                        label: '退出',
                        accelerator: 'CmdOrCtrl+Q',
                        click () {
                            console.log('ddddddddddddddddd')
                            app.quit()
                        }
                    }
                ]
            },
                {
                    label:'窗口',
                    submenu: [
                        {
                            label: '打开调试工具',
                            accelerator:'F12',
                            role:'toggleDevTools'
                            // click() {
                            //     win.webContents.openDevTools ()
                            // }
                        }
                    ]
                }
            ]
           let menu = Menu.buildFromTemplate(template)
            Menu.setApplicationMenu(menu)
        }
    }
}

module.exports=MenuPersonal
